package com.uzai.console.web.zombiefanpassive;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassive.ZombieFanPassiveIdDto;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassive.ZombieFanPassiveIdListDto;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassive.ZombieFanPassiveQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.sysmaterial.SysMaterialService;
import com.uzai.console.service.zombiefanpassive.ZombieFanPassiveService;
import com.uzai.console.vo.zombiefanpassive.zombiefanpassive.ZombieFanPassiveVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清理僵尸粉任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "被动僵尸粉",tags = "僵尸粉|被动僵尸粉")
@ApiSort(31)
@RestController
public class ZombieFanPassiveController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(ZombieFanPassiveController.class);

    @Autowired
    private ZombieFanPassiveService zombieFanPassiveService;
    @Autowired
    private SysMaterialService sysMaterialService;

    @ApiOperation(value = "分页查询被动僵尸粉列表", notes = "分页查询被动僵尸粉列表", response = ZombieFanPassiveVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/zombieFanPassive/findByPage")
    public Object findZombieFanPassivePage(@RequestBody ZombieFanPassiveQuery zombieFanPassiveQuery){
        return zombieFanPassiveService.findZombieFanPassiveList(zombieFanPassiveQuery);
    }

    @ApiOperation(value = "查询被动僵尸粉任务详情", notes = "查询被动僵尸粉任务详情", response = ZombieFanPassiveVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/zombieFanPassive/findById")
    public Object findZombieFanPassive(@RequestBody ZombieFanPassiveIdDto zombieFanPassiveIdDto){
        return zombieFanPassiveService.findZombieFanPassive(zombieFanPassiveIdDto);
    }

    @SystemLogType(model = SystemModelEnum.ZombieFanPassive, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "批量删除被动僵尸粉", notes = "批量删除被动僵尸粉")
    @ApiOperationSupport(order = 3)
    @PostMapping("/zombieFanPassive/batchDelete")
    public Object batchDeleteZombieFanPassive(@RequestBody ZombieFanPassiveIdListDto zombieFanPassiveIdListDto){
        zombieFanPassiveService.batchDeleteZombieFanPassive(zombieFanPassiveIdListDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.ZombieFanPassive, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "发送添加被动僵尸粉消息", notes = "发送添加被动僵尸粉消息")
    @ApiOperationSupport(order = 3)
    @PostMapping("/zombieFanPassive/sendMsg")
    public Object sendMsg(@RequestBody ZombieFanPassiveIdDto zombieFanPassiveIdDto){
        zombieFanPassiveService.sendMsg(zombieFanPassiveIdDto);
        return true;
    }

}
